<template>
	<view class="pagesWhite">
		<!-- 头部 -->
		<!-- #ifdef H5 -->
		<view class="upIcon-box" v-if="isWeixin">
			<view class="upIcon-wrapper">
				<image class="img" src="@/static/public/upIcon.png" mode=""></image>
				<view class="upIcon-title">请打开外部浏览器下载</view>
			</view>
		</view>
		<!-- #endif -->
		<!-- 头部 -->
		<!-- #ifdef APP-PLUS -->
		<view class="header_bar">
			<view class="header">
				<view class="header-goWhiteBack" @click="$tools.back(1)"></view>
			</view> 
		</view>
		<!-- #endif -->
			<view class="top">
				<image src="../../static/pack/indexLogo.png" mode=""></image>
				<view class="nameBox">
					<!-- <view class="name">Hello！</view> -->
					<view class="name">善鑫聚</view>
				</view>
			</view>
		
		<view>
			
			<view class="btnBox">
				<!-- <view class="btn btnborder" @tap.stop="getDownload(2)">
					<image src="@/static/pack/iOS--white.png" mode=""></image>
					<view>IOS版下载</view>
				</view> -->
				<view class="btn" @tap.stop="getDownload(1)">
					<image src="@/static/pack/Android--white.png" mode=""></image>
					<view>Android版本下载</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		components:{
		},
		data(){
			return{
				isWeixin: true,
				appVersion: [],
			}
		},
		onLoad() {
			
		},
		onShow() {
			this.init();
		},
		methods: {
			init(){
				this.isWx();
				// this.getAppInfo();
			},
			getDownload(type){
				var data = {};
				data['deviceType'] = type == 1 ? 'android' : 'ios';
				console.log("data:",data);
				this.$Ajax('/api/common/getLastVersion',data, res => {
						if(res.code == 200){
							// #ifdef APP-PLUS
								plus.runtime.openURL(res.data.versionUrl);
							// #endif
							// #ifdef H5
								location.href = res.data.versionUrl;
							// #endif
						}
					}, err => {
					}, 'GET', false
				);
			},
			isWx(){
				var ua = navigator.userAgent.toLowerCase();
				this.isWeixin = ua.indexOf('micromessenger') != -1;
				console.log("isWeixin:",this.isWeixin);
			},
		}
	}
</script>

<style scoped lang="scss">
	page{
		// background: #fff;
	}
	.pagesWhite{
		background: url('@/static/pack/downloadBg.png');
		background-repeat: no-repeat;
		background-size: 100% 100%;
		background-color: #FFFFFF;
		// background:  linear-gradient( 180deg, #FD4728 0%, #fff 100%), #F4010A;
		// box-shadow: 0rpx 8rpx 36rpx 0rpx rgba(80,80,80,0.4);
		height: 100vh;
		width: 100vw;
	}
	.header + uni-view{
		padding-top: 0 !important;
	}
	.top{
		padding-top: 0 !important;
		margin-top: 88rpx;
		/* #ifdef APP-PLUS */
		margin-top: 0rpx;
		/* #endif */
		text-align: center;
		image{
			width:232rpx ;
			height: 232rpx;
			margin: auto;
		}
		.name{
			margin-top: 20rpx;
			font-weight: 500;
			font-size: 48rpx;
			color: #FFFFFF;
			line-height: 40rpx;
		}
	}
	.first{
		width: 100vw;
		height: 1222rpx;
	}
	
	
	
	.btnBox{
		position: absolute;
		bottom: 140rpx;
		width: 100%;
		margin: auto;
		image{
			width: 60rpx;
			height: 60rpx;
			margin-right: 20rpx;
		}
		.btn{
			color: #fff;
			@include flexCenter;
			width: 522rpx;
			margin: auto;
			text-align: center;
			height: 108rpx;
			line-height: 108rpx;
			background: #EE3A33;
			// box-shadow: 0rpx 8rpx 36rpx 0rpx rgba(189,44,37,0.4);
			border-radius: 20rpx;
			// padding: 25rpx 0;
			&:nth-child(1){
				margin-bottom: 48rpx;
			}
		}
	}
	
</style>